package com.eastmoney.emis.edda.domain.valueobject;

import com.eastmoney.emis.edda.infrastructure.exception.EddaExceptionStatus;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.domain.valueobject
 * @author: 汪程程
 * @date: 2022/10/12 4:20 PM
 * @version: 1.0
 */
public enum RejectReasonCode {

    MPP04000("OTP identity number is invalid", EddaExceptionStatus.OTP_INVALID),
    MPP04001("OTP attempt exceeds max. retry limit", EddaExceptionStatus.OTP_LIMIT),
    MPP04002("OTP regeneration exceeds daily limit", EddaExceptionStatus.OTP_LIMIT),
    MPP04003("OTP confirmation code is invalid", EddaExceptionStatus.OTP_INVALID),
    MPP04004("OTP is expired", EddaExceptionStatus.OTP_INVALID),
    MPP01005("Debtor Account Name / Debtor Private Identification not matched", EddaExceptionStatus.UNMATCHED_ACCOUNT_INFO),
    MPP01006("Customer mobile number is invalid", EddaExceptionStatus.INVALID_APPLY_INFO),
    MPP01007("Debtor account name not matched", EddaExceptionStatus.INVALID_APPLY_INFO),
    MPP01008("Customer does not maintain mobile number in bank", EddaExceptionStatus.INVALID_APPLY_INFO),
    MPP01010("Duplicate Merchant Request Identification", EddaExceptionStatus.INVALID_APPLY_INFO),
    MPP01023("Invalid debtor mobile number maintained in HSBC", EddaExceptionStatus.INVALID_APPLY_INFO),
    MFISAC01("Incorrect debtor account number or debtor account type", EddaExceptionStatus.INVALID_ACCOUNT_OR_ACCOUNT_TYPE),
    MPP09000("Invalid data length or format in API request", EddaExceptionStatus.INVALID_DATA_FORMAT),

    ;


    private String message;

    private EddaExceptionStatus exceptionStatus;

    RejectReasonCode(String message, EddaExceptionStatus status) {
        this.message = message;
        this.exceptionStatus = status;
    }

    public String message() {
        return message;
    }

    public String formatMessage() {
        return name() + ":" + message;
    }

    public EddaExceptionStatus exceptionStatus() {
        return exceptionStatus;
    }
}
